//
//  SEGSharedNeihborhoodCommentModel.m
//  ExcellentHome
//
//  Created by 揭婧雯 on 2017/10/19.
//  Copyright © 2017年 陈区. All rights reserved.
//

#import "SEGSharedNeihborhoodCommentModel.h"

#if __has_include(<Commom/SEGUtils.h>)
#import <Commom/SEGUtils.h>
#else
#import "headerSEGUtils.h"
#endif

@implementation SEGSharedNeihborhoodCommentModel
+ (instancetype)initWithDictionary:(NSDictionary*)dictionary
{
    return [[self alloc] initWithDictionary:dictionary];
}

- (instancetype)initWithDictionary:(NSDictionary*)dictionary
{
    self = [super init];
    if (self) {
        _commentId = @"";
        _content = @"";
        _user = [[SEGSharedCommonUserModel alloc] init];
        [self setValuesForKeysWithDictionary:dictionary];
    }
    return self;
}

- (void)setValue:(id)value forKey:(NSString*)key
{
    if ([key isEqualToString:@"user"]) {
        if ([value isKindOfClass:[NSDictionary class]]) {
            _user = [SEGSharedCommonUserModel initWithDictionary:value];
        }
        return;
    }
    [super setValue:value forKey:key];
}

- (void)setValue:(id)value forUndefinedKey:(NSString*)key
{}

- (void)setCommentId:(NSString*)commentId{
    _commentId = [[SEGUtils ValueToString:commentId]copy];
}

- (void)setContent:(NSString*)content{
    _content = [[SEGUtils ValueToString:content]copy];
}
@end
